<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/include_list_head.jsp" %>
    <script>
        $(function () {
            $("tr").has("td.zt:contains('是')").click(function(){
                var $this = $(this);
                setTimeout(function(){
                    $this.find(":checkbox").attr("checked","");
                    alert("已回答的问题不能修改或删除！");
                },1);
            })
        });
    </script>
</head>

<body>
<div id="scrollContent">

    <s:if test="actionErrors.size()>0 || actionMessages.size()>0 || fieldErrors.size()>0">
        <div id="SystemErrorMessage">
            <s:actionerror/>
            <s:actionmessage/>
            <s:fielderror/>
        </div>
    </s:if>

    <div class="box_tool_mid padding_right5">
        <div class="center">
            <div class="left">
                <div class="right">
                    <div class="padding_top8 padding_left10">
                        <table>
                            <tr>
                                <s:form theme="simple" name="ysform">
                                    <s:hidden name="pager.formname" value="ysform"/>
                                    <s:hidden name="pager.currentPageno" id="yspager_currentPageno"/>
                                    <td nowrap="nowrap" class="">
                                        回答人员类型：
                                        <s:select onchange="super_doSearch()" name="pwdQ.type"
                                                  list="#{'':'全部', '1':'教职工','2':'学生','3':'校领导'}"/>
                                    </td>
                                    <td align="center" nowrap="nowrap" class="">
                                        &nbsp;标题：
                                        <s:textfield name="pwdQ.title" size="20"/>
                                    </td>
                                    <td align="center" nowrap="nowrap" class="">
                                        &nbsp;状态：
                                        <s:select onchange="super_doSearch()" name="pwdQ.state"
                                                  list="#{'':'全部','1':'启用','0':'禁用'}"/>
                                    </td>
                                </s:form>
                                <td>
                                    <button type="button" onclick="super_doSearch()"><span class="icon_find">查询</span>
                                    </button>
                                    <button type="button" onclick="doreset();"><span class="icon_recycle">重置</span>
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="userRoleMenuButton">
        <button type="button" onclick="openEntity('',false,'zdlb=<s:property value="tsysCode.zdlb"/>')"><span
                class="icon_add">新增</span></button>
        <button type="button" onclick="doModify()"><span class="icon_edit" title="">修改</span></button>
        <button type="button" onclick="doRemove()"><span class="icon_delete" title="">删除</span></button>
        <button onclick="doUniChangeState(1,this)"><span class="icon_ok" title="">启用</span></button>
        <button onclick="doUniChangeState(0,this)"><span class="icon_no" title="">禁用</span></button>
        <s:hidden name="changestate_parms" id="changestate_parms"
                  value="%{@com.apexedu.util.crypto.CipherUtil@encryptByAES('entityName:t_pwd_q;idName:wid;stateName:state')}"/>
    </div>
    <div>
        <table class="treeTable" headFixMode="true" expandable="false"
               useMultColor="false" useCheckBox="false">
            <tr>
                <th height="20px" width="5%"></th>
                <th width="15%">回答人员类型</th>
                <th width="40%">标题</th>
                <th width="15%">状态</th>
                <th width="15%">排序值</th>
                <th width="15%">是否已回答</th>
            </tr>
            <s:iterator value="resultData">
                <tr>
                    <td>
                        <s:checkbox id="%{wid}" name="selectNode" fieldValue="%{wid}"/>
                    </td>
                    <td>
                        <s:if test="%{type.indexOf('1')>=0}">教职工&nbsp;</s:if>
                        <s:if test="%{type.indexOf('2')>=0}">学生&nbsp;</s:if>
                        <s:if test="%{type.indexOf('3')>=0}">校领导&nbsp;</s:if>
                    </td>
                    <td>
                        <s:if test="answer==1">
                            <s:property value="title"/>
                        </s:if>
                        <s:else>
                            <a href="javascript:openEntity('<s:property value="wid"/>')"><FONT color="blue"><s:property
                                    value="title"/></FONT></a>
                        </s:else>
                    </td>
                    <td>
                        <s:if test="state==0">禁用</s:if>
                        <s:else>启用</s:else>
                    </td>
                    <td>
                        <s:property value="orderno"/>
                    </td>
                    <td class="zt">
                        <s:if test="answer==1"><font color="red">是（不能修改、删除）</font></s:if>
                        <s:else>否</s:else>
                    </td>
                </tr>
            </s:iterator>
        </table>
    </div>

    <div style="height: 45px;">
        <div id="pagelist" style="display: none">
            <s:property value="pager.postToolBar" escape="false"/>
        </div>

        <div class="clear"></div>
    </div>
</div>
</body>
</html>
